<template>
  <view>
    <TopNavCustom :title="title"></TopNavCustom>
    <view class="process-bar">
      <text class="time">{{ time }}</text>
      <u-steps current="0" activeColor="#ee0013" class="steps">
        <u-steps-item title="进度情况"> </u-steps-item>
        <u-steps-item title="质量情况"> </u-steps-item>
        <u-steps-item title="安全情况"> </u-steps-item>
        <u-steps-item title="提交审批"> </u-steps-item>
      </u-steps>
    </view>
    <StepOne :node="_node" @saveData="saveData" @goToNext="goto"></StepOne>
  </view>
</template>

<script>
export default {
  onLoad(node) {
    this.temp = node.item;
    this._node = JSON.parse(decodeURIComponent(node.item));
    this.title = this._node.partName;
	console.log(this._node)
  },
  data() {
    return {
      time: uni.$u.timeFormat(false, "yyyy-mm-dd"),
      nodeData: "",
      title: "",
      temp: "",
      _node: {},
    };
  },
  methods: {
    //获取并存储第一步数据
    saveData(data) {
      let uuid = this._node.estateId + "pm";
      console.log("存储第一步数据的UUid :" + uuid);
      uni.setStorageSync(uuid, JSON.stringify(data));
      console.log("存储的data");
	  console.log(uni.getStorageSync(uuid))
    },
    goto() {
      let _url =
        "/pages/ihome/public_building_QS/public_building_QS?item=" + this.temp;
      uni.navigateTo({
        url: _url,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.process-bar {
  // display: block;
  border: 1rpx solid #efefef;
  border-radius: 20rpx;
  background-color: #ffffff;
  padding: 30rpx;
  margin-bottom: 20rpx;

  .steps {
    // display: block;
    margin-top: 45rpx;
  }
}
</style>
